package org.fujay.langchain4jserver.domain.knowledge.vo;

import lombok.Getter;

/**
 * 文件存储策略枚举
 */
@Getter
public enum StorageStrategy {
    LOCAL(1, "本地存储"),
    URL(2, "网络URL"),
    OSS(3, "对象存储");

    private final int code;
    private final String description;

    StorageStrategy(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static StorageStrategy fromCode(int code) {
        for (StorageStrategy strategy : StorageStrategy.values()) {
            if (strategy.getCode() == code) {
                return strategy;
            }
        }
        throw new IllegalArgumentException("Unknown StorageStrategy code: " + code);
    }
}
